package Lono::Action::FramedEdit;

use strict;
use warnings;

=head1 NAME

  Lono::Action::FramedEdit - mod_perl module for loading an editing window side-by-side with the origial scraped page.

=head1 DESCRIPTION

=head1 SYNOPSIS

=cut

use Apache::Constants qw( :common );
use Apache::Request;

=head1 HANDLER

=over 4

=item handler( $r )

=cut

sub handler {
    my $r = Apache::Request->new( shift );
    
    $r->send_http_header( 'text/html' );

    my $url = $r->param( 'url' );

    $r->print( '<html><frameset cols="50%, 50%" rows="*">' );
    $r->print( '<frame name="generated" src="http://localhost/import?url=' .
               $url . '">' );
    $r->print( '<frame name="original" src="' . $url . '">' );
    $r->print( '</frameset></html>' );
                
    return OK;
}

1;
